﻿<%@ Page Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="CuentaCorriente.aspx.cs" Inherits="WC.UI.WebApp.CuentaCorriente" Title="Untitled Page" %>
<%@ Register namespace="AjaxControlToolkit" tagprefix="AjaxControlToolkit" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Maestro Perú - Clientes</title>
    <script type="text/javascript">
        function getCodigo(source, eventArgs)
        {
            $get('<%= txtCodCuentaDeudor.ClientID %>').value = eventArgs.get_value();
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphMainHeader" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMainBody" runat="server">

    <div style="width: 905px; text-align:left;">
        <table style="width:100%;">
            <tr><th colspan="2">Cuenta Corriente</th></tr>
            <tr><td colspan="2">&nbsp;</td></tr>
            <tr>
                <td colspan="2" style="background-color: #FFFBD6;">
                    &nbsp;
                    <asp:ImageButton ID="ibtnBuscar" runat="server" ImageUrl="~/img/find.png" onclick="ibtnBuscar_Click" />
                </td>
            </tr>
            <tr><td colspan="2">&nbsp;</td></tr>
            <tr>
                <td style="width:17%;">Cuenta de Deudor:</td>
                <td>
                    <asp:TextBox ID="txtCodCuentaDeudor" runat="server" MaxLength="10" Width="90" />
                    <cc1:FilteredTextBoxExtender ID="ftbeCodCliente" runat="server" 
                        FilterType="Numbers" TargetControlID="txtCodCuentaDeudor" />
                    &nbsp;&nbsp; 
                    <asp:TextBox ID="txtNomCuentaDeudor" runat="server" Width="250" />
                    <cc1:AutoCompleteExtender ID="aceNomCliente" runat="server" 
                        CompletionInterval="100" 
                        CompletionListCssClass="autocomplete_completionListElement" 
                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem" 
                        CompletionListItemCssClass="autocomplete_listItem" CompletionSetCount="15" 
                        DelimiterCharacters="" MinimumPrefixLength="1" OnClientItemSelected="getCodigo" 
                        ServiceMethod="buscaClientes" TargetControlID="txtNomCuentaDeudor">
                    </cc1:AutoCompleteExtender>
                </td>
            </tr>
            <tr>
                <td>Partidas abiertas hasta:</td>
                <td>
                    <asp:TextBox ID="txtFechaAbiertas" runat="server" Width="70" />
                    <cc1:CalendarExtender ID="CalendarExtender2" runat="server" Enabled="True" CssClass="MyCalendar"
                        Format="dd/MM/yyyy" TargetControlID="txtFechaAbiertas">
                    </cc1:CalendarExtender>
                </td>
            </tr>
        </table>
        <br />
        <div style="vertical-align: middle;">
            <asp:ImageButton ID="ibtnExcel" runat="server"  ImageUrl="~/img/excel.png" Height="18px" Width="18px" onclick="ibtnExcel_Click" />
            <asp:Label ID="lblExportar" runat="server" Text="Exportar a Excel" />
        </div>
        <br />
        <asp:GridView ID="dgPartidas" runat="server" AllowSorting="true" Width="100%" Font-Size="11px"
            AutoGenerateColumns="false" ShowFooter="true" 
            OnRowDataBound="dgPartidas_RowDataBound" onrowcreated="dgPartidas_RowCreated">
            <Columns>
                <asp:BoundField DataField="FechaDoc" HeaderText="Fecha doc." DataFormatString="{0:dd/MM/yyyy}" >
                    <ItemStyle HorizontalAlign="Center" Width="35px" />
                </asp:BoundField>
                <asp:BoundField DataField="FecVenc" HeaderText="Venc. neto" DataFormatString="{0:dd/MM/yyyy}" >
                    <ItemStyle HorizontalAlign="Center" Width="35px" />
                </asp:BoundField>
                <asp:BoundField DataField="NumDocumento" HeaderText="N° doc.">
                    <ItemStyle Width="50px" />
                </asp:BoundField>
                <asp:BoundField DataField="CondPago" HeaderText="CPag">
                    <ItemStyle Width="30px" />
                </asp:BoundField>
                <asp:BoundField DataField="Demora" HeaderText="Demora">
                    <ItemStyle Width="30px" HorizontalAlign="Right" />
                </asp:BoundField>
                <asp:BoundField DataField="ClaseDoc" HeaderText="Cla">
                    <ItemStyle Width="20px" />
                </asp:BoundField>
                <asp:ImageField DataAlternateTextField="StrVencido" DataImageUrlField="UrlVencido" HeaderText="VD">
                    <ItemStyle Width="20px" HorizontalAlign="Center" />
                </asp:ImageField>
                <asp:BoundField DataField="CodReferencia" HeaderText="Referencia">
                    <ItemStyle Width="100px" />
                </asp:BoundField> 
                <asp:TemplateField>
                    <HeaderTemplate>
                        Mon
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%# Eval("Moneda")%>&nbsp;
                    </ItemTemplate>
                    <FooterTemplate>
                        <table width="100%" border="0" style="border-style: none">
                            <tr>
                                <td>
                                    PEN: 
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    USD: 
                                </td>
                            </tr>
                        </table>
                    </FooterTemplate>
                    <ItemStyle HorizontalAlign="Center" Width="20px"  VerticalAlign="Top" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Importe en MD
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%# Eval("Importe")%>&nbsp;
                    </ItemTemplate>
                    <FooterTemplate>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
                            <tr>
                                <td align="right">
                                    <asp:Literal ID="LabelPEN" runat="server" Text=""  ></asp:Literal>&nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    <asp:Literal ID="LabelUSD" runat="server" Text="" ></asp:Literal>&nbsp;
                                </td>
                            </tr>
                        </table>
                    </FooterTemplate>
                    <ItemStyle HorizontalAlign="Right" Width="90px" VerticalAlign="Top" />
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderTemplate>
                        Importe en ML2
                    </HeaderTemplate>
                    <ItemTemplate>
                        <%# Eval("ImporteMonLocal")%>&nbsp;
                    </ItemTemplate>
                    <FooterTemplate>
                        <table width="100%" border="0">
                            <tr>
                                <td align="right"> 
                                    <asp:Literal ID="LabelML2" runat="server" Text="" ></asp:Literal>&nbsp;
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    &nbsp;  
                                </td>
                            </tr>
                        </table>
                    </FooterTemplate>
                    <ItemStyle HorizontalAlign="Right" Width="90px" VerticalAlign="Top" />
                </asp:TemplateField>              
                <asp:BoundField DataField="Texto" HeaderText="Texto" >
                    <ItemStyle Width="150px" />
                </asp:BoundField>
                
            </Columns>
            <AlternatingRowStyle CssClass="gvAltItem" />
            <HeaderStyle CssClass="gvHeader" />
            <FooterStyle CssClass="gvFooter" />
        </asp:GridView>

    </div>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphMainFooter" runat="server">
</asp:Content>
